home *** CD-ROM | disk | FTP | other *** search
- Path: d128-1.cpe.melbourne.aone.net.au!user
- From: reality@c031.aone.net.au (Virgil Reality)
- Newsgroups: comp.lang.c++
- Subject: Getting a simple string class on the Mac to work?
- Date: Wed, 17 Apr 1996 18:16:19 +1000
- Organization: Reality Bytes
- Message-ID: <reality-1704961816190001@d128-1.cpe.melbourne.aone.net.au>
- Reply-To: reality@c031.aone.net.au
- NNTP-Posting-Host: d128-1.cpe.melbourne.aone.net.au
-
- Hi
-
- I am trying to do my University Homework at home on my Mac and just converting
- simple stuff over to my compiler.
-
- I am a real newbie to C++ and all I want to do is use cstring.h.
- The word is "string" in Borland and "CString" in Symantec for the Macintosh.
-
- The problem is the Borland version compiles with ease and the Symantec
- version gives me some error about void.(See Below).
-
- It╣s so simple and yet I can╣t understand what's wrong. I am only trying
- to be ANSI C++ compliant at this level of my course.
-
-
-
- // Borland Windows Version 4.5
- #include <cstring.h>
- #include <iostream.h>
-
- void main()
- {
- cout << "What is your name?" << endl;
- string name;
- cin >> name;
- cout << "Your name is " << name << endl;
-
- return;
- }
-
- This works fine no problems.
-
-
- // Symantec Macintosh Version 8.4
- #include <cstring.h>
- #include <iostream.h>
-
- void main()
- {
- cout << "What is your name?" << endl;
- CString name;
- cin >> name;
- cout << "Your name is " << name << endl;
-
- return;
- }
-
-
- This does not compile yet it is a simple string class no tricks.
- What's wrong with my compiler.
- I╣m only setting up my project as ANSI C++ Compliant
-
- The errors are.
-
- File │main.cp▓; Line 12
- Error: illegal operand types
- Had: void *
-
- File │main.cp▓; Line 12
- Warning: value of expression is not used
-
-
- Thanks in advance for your help.
-
- Kindest Regards
- Virgil Reality...
-